<?php

namespace backend\models\system;

use Yii;
use backend\models\system\SysConfig;

/**
 * ContactForm is the model behind the contact form.
 */
class SettingserviceFrom extends SysConfig
{
	public $qq_status;
	public $qq_message;
	public $qq_group;
	public $work_time;
	public $phone_message;
	public $wechat_code;
	public $work_email;
	public $qq_name;
	public $qq_number;
	/**
	 * @inheritdoc 验证规则
	 */
	public function rules()
	{
		return [
			[['qq_status','qq_message','qq_group','work_time','phone_message','work_email','qq_name','qq_number'], 'required'],
			//[['config_type'],'integer'],
		];
	}

	public function attributeLabels()
	{
		return [
			'qq_status' => '客服功能',
			'qq_message' => 'QQ客服设置',
			'qq_group' => 'QQ群设置',
			'work_time'=>'工作时间',
			'phone_message'=>'',
			'wechat_code'=>'',
			'work_email'=>'工作邮箱',
			'qq_name' =>'',
			'qq_number' =>'',
		];
	}

	/**
 * @inheritdoc  客服信息查询
 */
	static function servicesel()
	{
		return SysConfig::find()
			->where(['config_type'=>6])
			->asArray()
			->all();
	}

	/**
	 * @inheritdoc  根据id客服信息查询
	 */
	public function selvalbyid($config_id)
	{
		return SysConfig::find()
			->where(['config_id'=>$config_id])
			->asArray()
			->all();
	}
}